package com.ssa.server.domain.Infrastructure;

import com.ssa.server.domain.repository.UserRepository;
import com.ssa.server.domain.service.UserService;
import com.ssa.server.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 * ytx UserServiceImpl
 *
 * @author <a href="mailto:chenlsh@ytx.com">陈录顺</a>
 * @since 2.5.12
 */
@Service
public class UserServiceImpl implements UserService {

//
//    @PersistenceContext
//    private EntityManager entityManager;

    @Autowired
    private UserRepository userRepository;

    @Override
    public User findById(Long id) {
        return userRepository.findById(id).get();
    }

    @Override
    public User save(User user) {

        return userRepository.save(user);
    }
}
